home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness: Dealing with Change / Workplace Effectiveness: Dealing with Change.iso / pc / Menu.Dxr / 00013_PRINT Scripts.ls < prev    next >
Encoding:
Text File  |  1998-05-04  |  3.0 KB  |  71 lines

  1. on clearAnswers
  2.   set the text of member "PrintAllAnswers" to EMPTY
  3. end
  4.  
  5. on gatherAllParts
  6.   global gAllPart_1, gAllPart_2, gAllPart_3, gMasterData, gAllParts, gNoteArchive
  7.   if voidp(gAllPart_1) then
  8.     set gAllPart_1 to "Part 1 not completed by user." & RETURN & "--------------------------------------------------"
  9.   end if
  10.   if voidp(gAllPart_2) then
  11.     set gAllPart_2 to "Part 2 not completed by user." & RETURN & "--------------------------------------------------"
  12.   end if
  13.   if voidp(gAllPart_3) then
  14.     set gAllPart_3 to "Part 3 not completed by user." & RETURN & "--------------------------------------------------"
  15.   end if
  16.   set gAllParts to "Workplace Effectiveness, Dealing with Change" & RETURN & "Exploration begun at " & getTimeDate(gMasterData) & RETURN & RETURN
  17.   put gAllPart_1 & RETURN & RETURN & gAllPart_2 & RETURN & RETURN & gAllPart_3 & RETURN & RETURN after gAllParts
  18.   if voidp(gNoteArchive) then
  19.     put "No notes were taken during this session." & RETURN after gAllParts
  20.   else
  21.     put "The following are the notes you entered during this session:" & RETURN & gNoteArchive & RETURN after gAllParts
  22.   end if
  23.   set the text of member "PrintAllAnswers" to gAllParts
  24. end
  25.  
  26. on writeScoreFile
  27.   global gAllParts, gSep
  28.   set ScoreFN to getOSDirectory() & gSep & "score.txt"
  29.   put "ScoreFN = " && ScoreFN
  30.   set writeScObj to new(xtra("fileio"))
  31.   openFile(writeScObj, ScoreFN, 2)
  32.   set wrStatus to status(writeScObj)
  33.   case wrStatus of
  34.     0:
  35.       writeString(writeScObj, gAllParts)
  36.       set wrStatus to status(writeScObj)
  37.       if wrStatus <> 0 then
  38.         displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
  39.       end if
  40.       closeFile(writeScObj)
  41.       set writeScObj to 0
  42.       alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
  43.     (-43), (-37):
  44.       createFile(writeScObj, ScoreFN)
  45.       set wrStatus to status(writeScObj)
  46.       if wrStatus <> 0 then
  47.         displayErrorMsg("attempting to write your Score information(CREerr).", wrStatus, writeScObj)
  48.       end if
  49.       openFile(writeScObj, ScoreFN, 2)
  50.       set wrStatus to status(writeScObj)
  51.       if wrStatus <> 0 then
  52.         displayErrorMsg("attempting to write your Score information.(CRE/OPNerr)", wrStatus, writeScObj)
  53.       end if
  54.       setFinderInfo(writeScObj, "TEXTTTXT")
  55.       writeString(writeScObj, gAllParts)
  56.       set wrStatus to status(writeScObj)
  57.       if wrStatus <> 0 then
  58.         displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
  59.       end if
  60.       closeFile(writeScObj)
  61.       set writeScObj to 0
  62.       alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
  63.     otherwise:
  64.       displayErrorMsg("attempting to write your Score information. The error:", wrStatus, writeScObj)
  65.   end case
  66. end
  67.  
  68. on displayErrorMsg whatMsg, whatError, whatObj
  69.   alert("An error has occured" && whatMsg && "The error:" && error(whatObj, whatError))
  70. end
  71.